<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>在MacOS上用Homebrew安装 Elasticsearch | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'brew.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/brew.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/brew.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/brew.html" rel="nofollow" target="_blank">../en/brew.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch 权威指南 [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="setup.html">安装设置</a></span>
»
<span class="breadcrumb-link"><a href="install-elasticsearch.html">安装 Elasticsearch</a></span>
»
<span class="breadcrumb-node">在MacOS上用Homebrew安装 Elasticsearch</span>
</div>
<div class="navheader">
<span class="prev">
<a href="docker.html">« 用Docker安装 Elasticsearch</a>
</span>
<span class="next">
<a href="settings.html">配置 Elasticsearch »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="brew"></a>
在MacOS上用Homebrew安装 Elasticsearch
</h2>
</div></div></div>
<p>
Elastic 发布了 Homebrew 方案，这样你就可以使用<a href="https://brew.sh/" class="ulink" target="_top">Homebrew</a>包管理器来安装 Elasticsearch。
</p>
<p>
要使用 Homebrew 安装，首先要 tap 一下 Elastic Homebrew 存储库。
</p>
<div class="pre_wrapper lang-sh">
<pre class="programlisting prettyprint lang-sh">brew tap elastic/tap</pre>
</div>
<p>
一旦 tap 了 Elastic Homebrew 存储库，就可以用<code class="literal">brew install</code>安装 Elasticsearch 的<span class="strong strong"><strong>最新版本</strong></span>。
</p>
<div class="pre_wrapper lang-sh">
<pre class="programlisting prettyprint lang-sh">brew install elastic/tap/elasticsearch-full</pre>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="brew-layout"></a>
Homebrew安装的目录结构
</h3>
</div></div></div>
<p>
当你使用<code class="literal">brew install</code>安装 Elasticsearch 时，配置文件、日志及数据目录存储在以下位置：
</p>
<div class="informaltable">
<table border="1" cellpadding="4px">
<colgroup>
<col class="col_1">
<col class="col_2">
<col class="col_3">
<col class="col_4">
</colgroup>
<thead>
<tr>
<th align="left" valign="top">类型</th>
<th align="left" valign="top">描述</th>
<th align="left" valign="top">默认位置</th>
<th align="left" valign="top">设置</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top"><p><span class="strong strong"><strong>home</strong></span></p></td>
<td align="left" valign="top"><p>Elasticsearch 主目录 或 <code class="literal">$ES_HOME</code></p></td>
<td align="left" valign="top"><p><code class="literal">/usr/local/var/homebrew/linked/elasticsearch-full</code></p></td>
<td align="left" valign="top"><p></p></td>
</tr>
<tr>
<td align="left" valign="top"><p><span class="strong strong"><strong>bin</strong></span></p></td>
<td align="left" valign="top"><p>
二进制脚本，包含启动一个节点的<code class="literal">elasticsearch</code>，以及安装插件的<code class="literal">elasticsearch-plugin</code>
</p></td>
<td align="left" valign="top"><p><code class="literal">/usr/local/var/homebrew/linked/elasticsearch-full/bin</code></p></td>
<td align="left" valign="top"><p></p></td>
</tr>
<tr>
<td align="left" valign="top"><p><span class="strong strong"><strong>conf</strong></span></p></td>
<td align="left" valign="top"><p>包含<code class="literal">elasticsearch.yml</code>的配置文件</p></td>
<td align="left" valign="top"><p><code class="literal">/usr/local/etc/elasticsearch</code></p></td>
<td align="left" valign="top"><p><code class="literal"><a class="xref" href="settings.html#config-files-location" title="Config files location">ES_PATH_CONF</a></code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p><span class="strong strong"><strong>data</strong></span></p></td>
<td align="left" valign="top"><p>
节点上的每个索引/分片的数据文件的位置。
可以设置多个位置。
</p></td>
<td align="left" valign="top"><p><code class="literal">/usr/local/var/lib/elasticsearch</code></p></td>
<td align="left" valign="top"><p><code class="literal">path.data</code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p><span class="strong strong"><strong>logs</strong></span></p></td>
<td align="left" valign="top"><p>日志文件的存放位置</p></td>
<td align="left" valign="top"><p><code class="literal">/usr/local/var/log/elasticsearch</code></p></td>
<td align="left" valign="top"><p><code class="literal">path.logs</code></p></td>
</tr>
<tr>
<td align="left" valign="top"><p><span class="strong strong"><strong>plugins</strong></span></p></td>
<td align="left" valign="top"><p>插件文件的存放位置。每个插件都放在一个子文件夹中。</p></td>
<td align="left" valign="top"><p><code class="literal">/usr/local/var/homebrew/linked/elasticsearch/plugins</code></p></td>
<td align="left" valign="top"><p></p></td>
</tr>
</tbody>
</table>
</div>
</div>

<div class="section exclude">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="_next_steps_7"></a>
下一步
</h3>
</div></div></div>
<p>
你现在已经设置了一个 Elasticsearch 测试环境。
在开始正式开发或开始使用 Elasticsearch 进行生产之前，你还必须做一些额外的设置：
</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
学习如何 <a class="xref" href="settings.html" title="Configuring Elasticsearch">配置 Elasticsearch</a>。
</li>
<li class="listitem">
配置 <a class="xref" href="important-settings.html" title="Important Elasticsearch configuration">重要的 Elasticsearch 设置</a>。
</li>
<li class="listitem">
配置 <a class="xref" href="system-config.html" title="Important System Configuration">重要的系统设置</a>。
</li>
</ul>
</div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="docker.html">« 用Docker安装 Elasticsearch</a>
</span>
<span class="next">
<a href="settings.html">配置 Elasticsearch »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>